/**
 @file sys_tsingma_port.h

 @author  Copyright (C) 2011 Centec Networks Inc.  All rights reserved.

 @date 2020-11-04

 @version v2.0

*/

#ifndef _SYS_TSINGMA_PORT_H
#define _SYS_TSINGMA_PORT_H
#ifdef __cplusplus
extern "C" {
#endif

/****************************************************************
 *
 * Header Files
 *
 ***************************************************************/
#include "sys_tsingma_datapath.h"
#include "sys_usw_port.h"

/****************************************************************
*
* Defines and Macros
*
****************************************************************/
#define SYS_USW_DMA_CHANNEL_NUM 4
/* misc channel for TM.MX, AT need modify */
#define SYS_USW_MISC_CHANNEL(chan_id)   ((((MCHIP_CAP(SYS_CAP_CHANID_CPU_MAC0) <= chan_id) && \
                                         (MCHIP_CAP(SYS_CAP_CHANID_DMA_RX0)   + SYS_USW_DMA_CHANNEL_NUM > chan_id)) || \
                                         (MCHIP_CAP(SYS_CAP_CHANID_DROP)   == chan_id)) \
                                         || (DRV_FROM_AT(lchip) &&(MCHIP_CAP(SYS_CAP_CHANID_EUNIT0) <= chan_id)))

extern int32
sys_tsingma_port_set_property(uint8 lchip, uint32 gport, ctc_port_property_t port_prop, uint32 value);

extern int32
sys_tsingma_port_get_property(uint8 lchip, uint32 gport, ctc_port_property_t port_prop, uint32* p_value);

extern int32
sys_tsingma_port_init(uint8 lchip);

extern int32
sys_tsingma_port_set_xpipe_en(uint8 lchip, uint32 gport, uint32 value);

#ifdef __cplusplus
}
#endif

#endif

